<template>
  <div>
    <van-grid :column-num="3" clickable>
      <van-grid-item :icon="item.icon" :text="item.name" v-for="item in cates" :key="item.id" @click="toCatePage(item.id)"/>
    </van-grid>
  </div>
</template>

<script>
export default {
  props: {
    cates: {
      type: Array,
      required: true
    }
  },
  methods: {
    toCatePage (id) {
      this.$router.push({
        path: '/cateItem',
        query: {
          cateId: id
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
